<admintpl file="header" />


<link href="__TMPL__Public/assets/css/infomation.css" rel="stylesheet" />
</head>
<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li><a href="{:U('SupervisionSideReport/index')}">旁站记录管理</a></li>
            <li class="active"><a href="{:U('SupervisionSideReport/edit')}">修改旁站记录</a></li>
        </ul>
        <form method="post" class="form-horizontal js-ajax-form" method="post" action="{:U('SupervisionSideReport/edit_post')}">
            <section class="tab-pane active fade in" id="access">

		        <div class="row">
		            <div class="col-xs-12 col-md-12 col-lg-12">
		                <div class="panel panel-info">
		                    <div class="panel-body">
	                            <div class="row tg-header">
	                                <div class="col-md-12 text-center">
	                                    <h3>旁站记录</h3>
	                                    <hr />
	                                </div>
                              <input type="hidden" name="id" value="{$data.id}" />
	                                <div class="col-md-12">
	                                    <p class="tg-to"><label>工程名称:</label><input type="text" class="input-xt input-deptname"   value="{$job_name}" /></p>

	                                    <p class="pull-right tg-serialnum"><label>编号:</label><input class="input-xt" name="code" value="{$data.code}"/></p>
	                                </div>
	                            </div>

	                            <table class="table table-bordered">
	                                <tr>
	                                    <td style="border-right:none !important;">
	                                        <label>旁站的关键部位、关键工序:</label>
	                                    </td>
	                                    <td>
	                                        <input type="text" class="input-xt input-deptname" name="side_position" value="{$data.side_position}"  />
	                                    </td>
	                                    <td style="border-right:none !important;">
	                                        <label>施工单位:</label>
	                                    </td>
	                                    <td>
	                                        <select name="executing_department" required style=" height:30px;width:100%">
	                                    		<volist name="depts" id="vo">
	                                    			<option></option>
	                                    			<option <if condition="$data['executing_department'] eq $vo['department_name']">selected</if>>{$vo.department_name}</option>
	                                    		</volist>	
                                    		</select>
	                                    </td>

	                                </tr>
	                                <tr>
	                                    <td>
	                                        <label>旁站开始时间</label>

	                                    </td>
	                                    <td>
	                                    	<input type="text" name="side_begin_time" id="from" class="input-xt input-deptname WdatePicker" value="{$data.side_begin_time|substr=0,16}" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'to\')}',dateFmt:'yyyy-MM-dd HH:mm'})"
                                             style="width:200px;"  required/>
	                                    </td>
	                                    <td>
	                                        <label>旁站结束时间</label>

	                                    </td>
	                                    <td>
	                                    	<input type="text" name="side_end_time" id="to" class="input-xt input-deptname" value="{$data.side_end_time|substr=0,16}" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'from\')}',dateFmt:'yyyy-MM-dd HH:mm'})"
                                             style="width:200px;" required/>
	                                    </td>
	                                </tr>
	                                <tr>
	                                    <td colspan="4">
	                                        <label>旁站的关键部位、关键工序施工情况：</label>
	                                        <textarea style="height:200px; width:100%" name="side_position_construction_status" >{$data.side_position_construction_status}</textarea>
	                                    </td>
	                                </tr>
	                                <tr>
	                                    <td colspan="4">
	                                        <label>发现的问题及处理情况：</label>
	                                        <textarea style="height:200px; width:100%" name="problem_and_solution" >{$data.problem_and_solution}</textarea>
	                                    </td>
	                                </tr>
	                                <tr>
	                                	<td colspan="4">
	                                        <p>
                                                <lable>附件：</lable>
                                                <div class="controls">
		                                            <a class="btn upBtn btn-primary" href="javascript:void(0);">上传</a>
		                                            <input type="file" id="upFile" name="upFile" style="display:none" />
		                                        </div>
                                                <foreach name="results" item="vo">
								                    <div class='controls' style='margin-top:10px;margin-left:20px'>
								                        <a class="fileDownload" path="{$vo.file_path}" name="{$vo.file_name}" data-type="{$vo.file_type}">{$vo.file_name}</a>
								                        <a href='javascript:void(0)' class='btn btn-danger btn-xs delFile' value="{$vo.id}">删除</a>
								                    </div>
								                </foreach>
                                            </p>
	                                    	<div class="signature">
                                                <p>
                                                    <label>旁站监理人员（签字）</label>
                                                </p>
                                            </div>
                                            <p class="signature-date">
                                                <span>年</span>
                                                <span>月</span>
                                                <span>日</span>
                                            </p>
	                                    </td>
	                                </tr> 
	                            </table>
	                            <div class="form-actions">
					                <button type="submit" class="btn btn-primary js-ajax-submit">{:L('SAVE')}</button>
					                <if condition="$Role == 3 || $Role == 0">
					                	<input type="hidden" value="{$data.is_publish}" name="is_publish" id="is_publish">
										<input type="submit" class="btn btn-warning" id="btnPublish" value="发布"/>
					                </if>
					                <a class="btn btn-default" href="javascript:history.back(-1);">{:L('BACK')}</a>
					            </div>
		                    </div>
		                </div>
		            </div>

		        </div>
    		</section>
        </form>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
    <script language="javascript" type="text/javascript" src="__PUBLIC__/js/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        $(document).ready(function(e) {
            
            // 选择图片
            $(document).on("click", ".upBtn", function(e) {
                $("#upFile").click();
            });
            // 文件选择器change事件
            $("#upFile").on("change", function(){
                UploadFile("{:U('SupervisionSideReport/upload')}", "supervision_side_report");
            });
            $(document).on("click", ".delFile", function(){
                if($(this).attr("value") != undefined){
                    delFile("{:U('SupervisionSideReport/delFile')}", $(this).attr("value"), $(this))
                } else {
                    $(this).closest("div").remove();
                }
            });
        });
    </script>
</body>
</html>